Skip to content

fix(web): show shortcuts on disabled history arrows - #46049

Open
HernanJiang wants to merge 3 commits into
pingdotgg:mainfrom
HernanJiang:fix/sidebar-history-shortcut-tooltip
Open

HernanJiang wants to merge 3 commits into
pingdotgg:mainfrom
HernanJiang:fix/sidebar-history-shortcut-tooltip

Conversation

@HernanJiang

Copy link
Copy Markdown
Contributor

Problem

The desktop history arrows hide their tooltips when no history entry is available. Users cannot discover their configured shortcuts while either arrow is disabled.

Change

Anchor the tooltip to a wrapper while the arrow is disabled. The button keeps its native disabled behavior.

Scope

Fixes #45549.

Verification

On an isolated macOS desktop instance with Alt+Left and Alt+Right configured, hovering the disabled forward arrow on main showed no tooltip. On this branch it showed Go forward (⌥Right), and clicking the arrow kept the current history entry.

The Chromium regression test reproduces the missing tooltip on main and verifies both configured shortcuts on this branch. All 16 focused tests and vp run check:changed passed.

Before After
Disabled forward arrow without a tooltip Disabled forward arrow showing the configured shortcut

GPT-6.2 Sol via Codex.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).

New browser test files: apps/web/src/components/sidebar/SidebarChrome.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@macroscopeapp

macroscopeapp Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d300bc7

Macroscope's review found this PR approvable — Disabled sidebar history arrows now expose their shortcut tooltips through a hoverable wrapper. Navigation behavior and availability remain unchanged, keeping the change limited to presentation.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 68f88a1 and 51d3746.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The history navigation buttons now retain tooltip access when disabled. A browser test configures custom back and forward shortcuts, disables history navigation, and verifies that the tooltips show the shortcuts on Linux.

Changes: History Shortcut Tooltips

Layer / File(s) Summary
Disabled button tooltip behavior
apps/web/src/components/sidebar/SidebarChrome.tsx, apps/web/src/components/sidebar/SidebarChrome.browser.test.tsx
The history button is created separately and wrapped in a span when disabled. The browser test checks that disabled back and forward buttons show their configured shortcuts in tooltips.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review d300b

This change shows configured keyboard shortcuts in tooltips on disabled history arrows while they stay non-interactive. It affects a small, localized part of the UI, has a browser test, and shows no merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: disabled desktop history arrows now show their configured keyboard shortcuts in tooltips. It follows the conventional commit form and matches the raw summary, the obje…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification). The problem, the wrapper-based change, the linked issue, and the verification steps are all clear. Before/after sc…
Linked Issues check Passed [#45549] The issue requires the effective keyboard shortcut to appear in the history arrow tooltip, including custom bindings, and to stay visible when the arrow is disabled while the action stays non…
Out of Scope Changes check Passed The whole-PR changes, per the summary, touch only apps/web/src/components/sidebar/SidebarChrome.tsx and apps/web/src/components/sidebar/SidebarChrome.browser.test.tsx. The SidebarChrome.tsx chan…
Full details: Title check

Explanation

The title names the main change: disabled desktop history arrows now show their configured keyboard shortcuts in tooltips. It follows the conventional commit form and matches the raw summary, the objectives, and the linked issue #45549.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification). The problem, the wrapper-based change, the linked issue, and the verification steps are all clear. Before/after screenshots are included. The author also names the model and harness used. The Scope section gives a link to the issue but does not describe a maintainer request. This is a minor gap and does not block the check.

Full details: Linked Issues check

Explanation

[#45549] The issue requires the effective keyboard shortcut to appear in the history arrow tooltip, including custom bindings, and to stay visible when the arrow is disabled while the action stays non-interactive. At the reviewed head, HistoryNavigationButton in apps/web/src/components/sidebar/SidebarChrome.tsx builds the label from shortcutLabelForCommand(keybindings, 'navigation.back' | 'navigation.forward') using primaryServerKeybindingsAtom. The label is therefore driven by the effective configuration, not hardcoded. When enabled is false, the tooltip trigger renders a span wrapper around the disabled Button, so the tooltip anchors to the wrapper. The Button keeps disabled={!enabled} and its onClick is not reached while disabled. When the binding is unassigned, shortcutLabel is empty and no shortcut suffix is added, which matches the issue requirement that unassigned commands not advertise a shortcut. The key on SharedTooltipTrigger remounts the trigger when enabled state changes. The browser test in SidebarChrome.browser.test.tsx (per the summary) configures Alt+Left/Alt+Right and checks disabled-arrow tooltips on Linux Electron. Remaining uncertainty: I did not read the test file body, so the test assertions are taken from the summary and PR description. The issue's example format Alt+← differs from the existing helper output ⌥Right reported in the PR; the issue asks for the effective shortcut, and the helper is the existing source for that label. Unassigned-binding and live-update behavior are not separately verified in the PR evidence.

Full details: Out of Scope Changes check

Explanation

The whole-PR changes, per the summary, touch only apps/web/src/components/sidebar/SidebarChrome.tsx and apps/web/src/components/sidebar/SidebarChrome.browser.test.tsx. The SidebarChrome.tsx changes are limited to HistoryNavigationButton: the button is extracted into a variable, the tooltip trigger is keyed by enabled state, and a span wrapper is added while disabled. These changes directly implement the linked issue's disabled-arrow tooltip requirement. The test file change supports the same behavior. No unrelated code change is shown in the summary. The full file diff tool was unavailable (changed blobs missing from checkout), so I read the head file content directly and did not compare it line by line against the base.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8b60977 and d300bc7.

Files selected for processing: 2

  • apps/web/src/components/sidebar/SidebarChrome.browser.test.tsx
  • apps/web/src/components/sidebar/SidebarChrome.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:needs-julius Takeover done; route gate says Julius decides and removed takeover:in-progress A takeover lead is working on this PR labels Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). takeover:needs-julius Takeover done; route gate says Julius decides vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: History arrow tooltips fail to expose the working keyboard shortcut

3 participants